package com.example.demo.service;


import com.example.demo.entity.ArtDiscuss;
import com.example.demo.mapper.ArtDiscussMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DiscussService {

    @Autowired
    private ArtDiscussMapper discussMapper;

    /**
     * 添加评论
     */
    public Integer insDetail(ArtDiscuss artDiscuss) {
        return discussMapper.insDetail(artDiscuss);
    }

    /**
     *  获取文章评论
     */
    public List<ArtDiscuss> getDetail(Integer id) {
        return discussMapper.getDetail(id);
    }

    /**
     *  修改文章评论
     */
    public void setUserPhoto(Integer uid, String userphoto) {
        discussMapper.setUserPhoto(uid, userphoto);
    }

    /**
     *  修改评论区用户的昵称
     */
    public void setUserNickName(String nickName, Integer uid) {
        discussMapper.setUserNickName(nickName, uid);
    }
}
